import 'package:flutter_taotaoshipin/generated/json/base/json_convert_content.dart';
import 'package:flutter_taotaoshipin/model/order_apple_receipt_entity.dart';

OrderAppleReceiptEntity $OrderAppleReceiptEntityFromJson(
    Map<String, dynamic> json) {
  final OrderAppleReceiptEntity orderAppleReceiptEntity = OrderAppleReceiptEntity();
  final String? orderId = jsonConvert.convert<String>(json['order_id']);
  if (orderId != null) {
    orderAppleReceiptEntity.orderId = orderId;
  }
  final String? transactionId = jsonConvert.convert<String>(
      json['transaction_id']);
  if (transactionId != null) {
    orderAppleReceiptEntity.transactionId = transactionId;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    orderAppleReceiptEntity.status = status;
  }
  return orderAppleReceiptEntity;
}

Map<String, dynamic> $OrderAppleReceiptEntityToJson(
    OrderAppleReceiptEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['order_id'] = entity.orderId;
  data['transaction_id'] = entity.transactionId;
  data['status'] = entity.status;
  return data;
}

extension OrderAppleReceiptEntityExtension on OrderAppleReceiptEntity {
  OrderAppleReceiptEntity copyWith({
    String? orderId,
    String? transactionId,
    String? status,
  }) {
    return OrderAppleReceiptEntity()
      ..orderId = orderId ?? this.orderId
      ..transactionId = transactionId ?? this.transactionId
      ..status = status ?? this.status;
  }
}